Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add various options #433

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Add various options #433

wants to merge 3 commits into from

Conversation

lennartack
Copy link

These options make tdrop behave more like other drop-down terminals. Fixes #432.

@mr2rm
Copy link

mr2rm commented May 9, 2024

I tried this change but the top bar is still visible for me. I tested with the simplest form using this command:
tdrop -q kitty --start-as fullscreen

The below command didn't work either:
tdrop -amAq -w 100% -h 100% kitty --start-as fullscreen

@lennartack
Copy link
Author

@mr2rm Which window manager are you using? It might not support removing the title bar of an existing window.

Could you test using these commands?

xprop -format _MOTIF_WM_HINTS 32c -set _MOTIF_WM_HINTS "2, 0, 0, 0, 0"
xprop -format _MOTIF_WM_HINTS 32c -set _MOTIF_WM_HINTS "2, 0, 2, 0, 0"

After executing click on a Kitty window.

@mr2rm
Copy link

mr2rm commented May 10, 2024

@lennartack I tried that in Ubuntu and I use the default window manager of Ubuntu, the Gnome Shell. Also, I tested the two commands you sent but didn't get any output.

@lennartack
Copy link
Author

@mr2rm These xprop commands should remove the title bar. From Googling it appears that Gnome Shell doesn't support this method. People are using Gnome extensions to remove the title bar. If you can figure out a way to remove the title bar with a Bash command I can include it in the PR.

@lennartack
Copy link
Author

@mr2rm I see others are using a hexadecimal notation for the values with xprop. Could you try if the following works?

xprop -format _MOTIF_WM_HINTS 32c -set _MOTIF_WM_HINTS "0x2, 0x0, 0x0, 0x0, 0x0"

@mr2rm
Copy link

mr2rm commented May 10, 2024

@lennartack Any of the commands you mentioned don't work. Apparently, Gnome Shell doesn't support that. I had to use the below extension to get the job done. I couldn't find any other solution.

https://extensions.gnome.org/extension/1287/unite/

@noctuid
Copy link
Owner

noctuid commented May 11, 2024

This should all be possible without new flags (or if a new hook is necessary, I'd accept a PR for that). I'd accept a PR to add an example to the FAQ in the readme about sticky, but I'd rather not directly add this to tdrop. Better to just use whatever will work work for one's specific WM in a hook I think (wmctrl is also not currently a dependency of tdrop). Let me know if there's anything that would need to be changed directly in tdrop to support this.

@lennartack
Copy link
Author

@noctuid The title bar removal would require a new hook. It needs to execute before the window dimensions and location are changed by tdrop but after the window id is known.

@lennartack
Copy link
Author

That said, having these flags would make it much less painful to switch to tdrop on floating window managers. Guake and Yakuake work out of the box on many WMs, so it might be worth checking out how they do it and if there is a Bash equivalent. Even if you need different code for different WMs I think it's still worth it.

@lennartack
Copy link
Author

I did some more research about the title bar removal. Guake also seems to use _MOTIF_WM_HINTS and I think this works on (almost) all window managers. However, it appears that changing _MOTIF_WM_HINTS via xprop doesn't always work because it does not use the right data type (of the underlying C struct). I suspect that's also why @mr2rm was not able to get it to work. This C program probably does work: https://gist.github.com/muktupavels/d03bb14ea6042b779df89b4c87df975d. I tested on XFCE, where the C program works but the xprop command does not.

I guess adding C code is outside the scope of this project, so we can't have this option on many WMs. I think we need a tdrop in another language...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Title bar not hidden
3 participants